package com.code520.mamabike;

import org.apache.commons.collections.list.SynchronizedList;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Array;
import java.net.URL;
import java.util.*;

class User{
    public String id;

    public User(String id) {
        this.id = id;
    }

    public final void dosome(){
        System.out.println("B");
    }
}

class C {
    private static C c = new C();
    public static C getC(){
        return c;
    }

    protected void c(){
        System.out.println("c");
    }
}
class B extends C{
    protected void c(){
        System.out.println("b");
    }

    public String b(){
        String a = "xxx";
        return a;
    }
}

public class A extends B{
    public static void main(String[] args) {
        C c1 = C.getC();
        C c;
        C c2 = C.getC();
        System.out.println(c1==c2);
//        A a = new A();
//        a.c();

//        try {
//            FileInputStream file = new FileInputStream("C:\\Users\\Chaos\\Desktop\\files\\details.md");
//            byte[] multi = new byte[50];
//            int a = 0;
//            while((a = file.read(multi))!= -1){
//                System.out.print(new String(multi, 0, a));
//            }
//
//            Thread t = new Thread();

//            URL a = Thread.currentThread().getContextClassLoader().getResource("main/java/com/code520/mamabike/1.txt");
//        System.out.println();
//            String path = Thread.currentThread().getContextClassLoader().getResource("main/java/com/code520/mamabike/1.txt").getPath();
//            System.out.println(path);
//            Timer timer = new Timer();

//            timer.getClass().newInstance();
//        } catch (IllegalAccessException e) {
//            e.printStackTrace();
//        } catch (InstantiationException e) {
//            e.printStackTrace();
//        }


//        A a = new A();
//        C c = new C();
//        c.c();
//        String b = a.b();
//
//        List listrs = new ArrayList();
//        SynchronizedList slist = new SynchronizedList(listrs);
//
//        Collections.synchronizedList(new ArrayList<>());
//
//        String we = new String("we");
//        String wee = new String("we");
//        System.out.println(we.equals(wee));
//        System.out.println(we==wee);
//
//        String xxx = "xxx";
//        System.out.println(b == xxx);
//
//        User user1 = new User("12");
//        User user2 = new User("144");
//        User user3 = new User("62");
//        User user4 = new User("13");
//        User user5 = new User("21");
//
//        List<User> list = new ArrayList<>();
//
//        list.add(user1);
//        list.add(user2);
//        list.add(user3);
//        list.add(user4);
//        list.add(user5);
//
//
//        Collections.sort(list, (o1, o2) -> Integer.parseInt(o2.id) - Integer.parseInt(o1.id));
//
//        for (User user : list) {
//            System.out.print(user.id+" ");
//        }
//
//        int[] arr = new int[]{};
    }

    @Override
    protected void finalize(){
        System.out.println("回收");
    };

}
